package cn.gdpu.course.dao.impl;

import cn.gdpu.course.dao.MybatisDao;
import cn.gdpu.course.dao.StudentDao;
import cn.gdpu.course.dao.domain.Student;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Administrator on 2018/3/13.
 */
@Repository
public class StudentDaoImpl extends MybatisDao<Student> implements StudentDao {
	public boolean save(Student bean) {
		return this.insert("StudentMapper.insert", bean);
	}

	public boolean update(Student bean) {
		return this.insert("StudentMapper.update", bean);
	}

	public boolean delete(Student bean) {
		return this.insert("StudentMapper.delete", bean);
	}

	public List<Student> find(Student bean) {
		return this.queryForList("StudentMapper.select", bean);
	}

	public Student findById(Student bean) {
		return this.queryForObject("StudentMapper.selectById", bean);
	}

	public Student findBySno(Student bean) {
		return this.queryForObject("StudentMapper.selectBySno", bean);
	}

	public Student findBySname(Student bean) {
		return this.queryForObject("StudentMapper.selectBySname", bean);
	}
}
